// ==UserScript==
// @name         自动填表
// @namespace    http://tampermonkey.net/
// @version      1.0
// @updateURL       https://gitee.com/erbing315/ziDongTianBiao_danSha/blob/master/%E8%87%AA%E5%8A%A8%E5%A1%AB%E8%A1%A8.js
// @downloadURL     https://gitee.com/erbing315/ziDongTianBiao_danSha/blob/master/%E8%87%AA%E5%8A%A8%E5%A1%AB%E8%A1%A8.js
// @description  try to take over the world!
// @author       二饼
// @match        http://jkda.jxhfpc.gov.cn/view/main.page
// @icon         https://i1.hdslb.com/bfs/face/24a3276e6f3a5ecaefd29e0caa19fb5f8fb30ee1.jpg
// @require      http://jkda.jxhfpc.gov.cn/resource/js/jquery-easyui/jquery.easyui.min.js
// @grant        GM_setValue
// @grant        GM_getValue
// @grant        GM_listValues
// ==/UserScript==

(function() {
    'use strict';

    // Your code here...
    //https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js
    /*$(() => {
        console.log('111');
    })*/
    var tingZhi = false;
    var jiHua = GM_getValue('jiHua', 0);
    if (GM_getValue('ye', 0) == 0) {
        GM_setValue('hang', 0);
        GM_setValue('ye', 1);
    }

    function getPage(myPage) {
        if (Number(myPage.substr(2,3)) != NaN) {
            return Math.ceil(Number(myPage.substr(2,3)) / 20)
        } else if (Number(myPage.substr(2,2)) != NaN) {
            return Math.ceil(Number(myPage.substr(2,2)) / 20);
        } else {
            return 1;
        }
    }

    function Ram(from,to,xiaoShu = 0) {
        return Math.round(((Math.random() * (to - from))+from)*Math.pow(10,xiaoShu)) / Math.pow(10,xiaoShu);
    }

    function NewDate(age,male) {
        let newdate = new Array();
        if (typeof age != "number"){
            age = Number(age);
        }

        if (age > 18) {
            if (male){
                newdate[0] = Ram(155,180)
            } else {
                newdate[0] = Ram(150,175)
            }
        } else {
            if (male) {
                let i = 124 + (age - 7) * 4.36;
                newdate[0] = Ram(Math.max(i - 10, 124),Math.min(172, i+10));
            } else {
                let i = 122 + (age - 7) * 3.45;
                newdate[0] = Ram(Math.max(i - 10, 122),Math.min(160, i+10));
            }
        }
        newdate[1] = Ram(4.6, 5, 1);
        newdate[2] = Ram(4.6, 5, 1);
        newdate[3] = '毛妮';
        return newdate;
    }

    function XinJianDangAn() {
        var jktj = document.querySelector("#centerTabs > div.tabs-panels.tabs-panels-noborder.panel-noscroll > div:nth-child(3) > div > iframe").contentWindow;

        jktj.document.querySelector("body > div.panel.layout-panel.layout-panel-east > div.panel-body.layout-body > div:nth-child(1) > a").click();
        jktj.document.querySelector("#_easyui_tree_1").click();
        //jktj.document.querySelector("body > div:nth-child(10) > div.dialog-button > a").click();
        jktj.document.querySelector("#dlg-buttons1 > a").click();
        return;
    }

    var button = document.createElement("button");
    button.textContent = "翻到"+GM_getValue('ye', 1)+"页";
    button.addEventListener("click", function(){
        button.textContent = "即将停止";
        tingZhi = true;
    })

    var button1 = document.createElement("button");
    button1.textContent = "运行";
    button1.addEventListener("click", function(){

        if (Number(jiHang.value) == NaN || Number(jiHang.value) == 0) {
            alert('输入只含有数字的,大于零的行号');
            return;
        }

        tingZhi = false;
        var wanChengShu = 0;
        button1.textContent = '已经完成'+wanChengShu+'人';
        button.textContent = "停止";


        var jmcx = document.querySelector("#centerTabs > div.tabs-panels.tabs-panels-noborder.panel-noscroll > div.panel.easyui-fluid > div > iframe").contentWindow;

        jmcx.document.querySelector("body > div.panel.datagrid.easyui-fluid > div.datagrid-wrap.panel-body > div.datagrid-pager.pagination > table > tbody > tr > td:nth-child(7) > input").remove();
        jmcx.document.querySelector("body > div.panel.datagrid.easyui-fluid > div.datagrid-wrap.panel-body > div.datagrid-pager.pagination > table > tbody > tr > td:nth-child(7)").appendChild(jiYe);
        var year = new Date().getFullYear();

        var rawNumber = Number(jiHang.value) - 1;
        console.log('masaka');
        var zT = 0;
        /*0:居民查询-'双击进入->1'or'换页->0';
        1:'今年已填->0''今年未填->2''从未填->6';
        2:去年页面;
        3\6:新建页面 ->++
        4:填写页面 ->5
        5:关闭页面 ->0
        7:初创 ->4*/
        var pDate = new Array();
        //0:身高,1:左眼,2:右眼,3:'责任医生'
        var age,male;
        $(() => {})
        let main = setInterval(() => {
            if ( tingZhi ) {
                button.textContent = "已停止";
                clearInterval(main);
            }

            console.log('0.zT:'+zT);
            if (zT == 0){
                if (rawNumber > 19) {
                    console.log('下一页,,,');
                    rawNumber = 0;
                    GM_setValue('hang', 0)

                    jiHang.value = '1';
                    var myPage = jmcx.document.querySelector("body > div.panel.datagrid.easyui-fluid > div.datagrid-wrap.panel-body > div.datagrid-pager.pagination > div.pagination-info").innerHTML;
                    if (Number(myPage.substr(2,3))) {
                        GM_setValue('ye', Math.ceil(Number(myPage.substr(2,3)) / 20) + 1)
                        jiYe.value = GM_getValue('ye', 0).toString();
                    } else if (Number(myPage.substr(2,2))) {
                        GM_setValue('ye', Math.ceil(Number(myPage.substr(2,2)) / 20) + 1)
                        jiYe.value = GM_getValue('ye', 0).toString();
                    } else {
                        GM_setValue('ye', 2)
                        jiYe.value = '2';
                    }

                    jmcx.document.querySelector("body > div.panel.datagrid.easyui-fluid > div.datagrid-wrap.panel-body > div.datagrid-pager.pagination > table > tbody > tr > td:nth-child(10) > a").click();
                } else {
                    age = jmcx.document.querySelector("#datagrid-row-r1-2-"+rawNumber+" > td:nth-child(7) > div").innerHTML;
                    male = jmcx.document.querySelector("#datagrid-row-r1-2-"+rawNumber+" > td:nth-child(6) > div").innerHTML == '男';
                    console.log('双击'+rawNumber+'行,,,');
                    jmcx.$("#datagrid-row-r1-2-"+rawNumber).trigger('dblclick');
                    zT = 1;
                    console.log('0.1.zT:'+zT);
                }
            }else if (zT == 1) {
                var dangan;
                if (!(document.querySelector("#centerTabs > div.tabs-panels.tabs-panels-noborder.panel-noscroll > div:nth-child(3) > div > iframe").contentWindow.document.querySelector("#da_list_tree > li:nth-child(3) > ul"))) {
                    pDate = NewDate(age,male);
                    zT = 6;
                    console.log('1.0.zT:'+zT);
                    XinJianDangAn();
                } else {
                    dangan = document.querySelector("#centerTabs > div.tabs-panels.tabs-panels-noborder.panel-noscroll > div:nth-child(3) > div > iframe").contentWindow.document.querySelector("#da_list_tree > li:nth-child(3) > ul").childNodes;
                    for (let i = 0; i < dangan.length; i++) {
                        const eleYear = dangan[i].getElementsByClassName('tree-title')[0].innerHTML.substr(0,4);
                        if (eleYear == year.toString()){
                            zT = 5;
                            break;
                        } else if (eleYear == (year - 1).toString()) {
                            zT = 2;
                            dangan[i].childNodes[0].click();
                        } else {
                            alert('错误，获取历年档案失败');
                        }
                    }
                }
            } else if (zT == 2) {
                var jktj = document.querySelector("#centerTabs > div.tabs-panels.tabs-panels-noborder.panel-noscroll > div:nth-child(3) > div > iframe").contentWindow;
                pDate[0] = Number(jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(9) > td:nth-child(2) > label > span > input.textbox-value").getAttribute('value'));
                pDate[3] = jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(2) > td:nth-child(4) > label > input").getAttribute('value');
                XinJianDangAn();
                zT = 3;
            } else if (zT == 3 || zT == 6) {
                var jktj = document.querySelector("#centerTabs > div.tabs-panels.tabs-panels-noborder.panel-noscroll > div:nth-child(3) > div > iframe").contentWindow;
                //设置人群
                jktj.document.querySelector("#selectPeopleType > div > table > tbody > tr:nth-child(2) > td:nth-child(2) > a").click();
                if (document.querySelector("#centerTabs > div.tabs-panels.tabs-panels-noborder.panel-noscroll > div:nth-child(3) > div > iframe").contentWindow.document.querySelector("body > div.panel.window.messager-window > div.dialog-button.messager-button > a:nth-child(1)")) {
                    document.querySelector("#centerTabs > div.tabs-panels.tabs-panels-noborder.panel-noscroll > div:nth-child(3) > div > iframe").contentWindow.document.querySelector("body > div.panel.window.messager-window > div.dialog-button.messager-button > a:nth-child(1)").click();
                }
                //设置日期
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(2) > td:nth-child(2) > label > input").click();
                zT++;
            } else if (zT == 4) {
                var dataList = document.getElementById('indexLayout').children;
                for (let i = 0; i < dataList.length; i++) {
                    if (dataList[i].getAttribute('lang') == 'zh-cn') {
                        dataList[i].childNodes[0].contentWindow.document.querySelector("#dpOkInput").click();
                    }
                }

                var jktj = document.querySelector("#centerTabs > div.tabs-panels.tabs-panels-noborder.panel-noscroll > div:nth-child(3) > div > iframe").contentWindow;
                //设置责任医生
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(2) > td:nth-child(4) > label > input").setAttribute('value', pDate[3]);
                //设置症状
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(4) > td:nth-child(2) > label:nth-child(1)").click();
                //设置体温
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(6) > td:nth-child(2) > label > span > input.textbox-value").setAttribute('value', Ram(36, 36.5, 1).toString())
                //设置脉搏
                var xinLv = Ram(60, 90).toString();
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(6) > td:nth-child(4) > label > span > input.textbox-value").setAttribute('value', xinLv);
                //设置呼吸频率
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(7) > td:nth-child(2) > label > span > input.textbox-value").setAttribute('value', '20');
                //设置血压左高低、右~
                var lh,ll;
                if (age > 18) {
                    lh = Ram(100, 135);
                    ll = Ram(60, 80);
                    while (lh-ll>60 || lh-ll<30) {
                        ll = Ram(60, 80);
                    }
                } else if (age > 13) {
                    lh = Ram(90, 130);
                    ll = Ram(60, 80);
                    while (lh-ll>60 || lh-ll<25) {
                        ll = Ram(60, 80);
                    }
                } else {
                    lh = Ram(85, 120);
                    ll = Ram(60, 70);
                    while (lh-ll>60 || lh-ll<20) {
                        ll = Ram(60, 80);
                    }
                }
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(7) > td:nth-child(5) > label:nth-child(1) > span > input.textbox-value").value = lh;
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(7) > td:nth-child(5) > label:nth-child(2) > span > input.textbox-value").value = ll;
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(8) > td:nth-child(2) > label:nth-child(1) > span > input.textbox-value").value = lh + Ram(-4, 4);
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(8) > td:nth-child(2) > label:nth-child(2) > span > input.textbox-value").value = ll + Ram(-4, 4);
                //设置身高
                if (age < 20) {
                    pDate[0] += Ram(1, 5);
                }
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(9) > td:nth-child(2) > label > span > input.textbox-value").setAttribute('value', pDate[0].toString());
                //设置体重
                var weath;
                if (age > 12) {
                    if (male) {
                        weath = Math.round((pDate[0] - 80)*0.7);
                    } else {
                        weath = Math.round((pDate[0] - 70)*0.6);
                    }
                } else {
                    weath = age*2 + Ram(8, 12);
                }
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(9) > td:nth-child(4) > label > span > input.textbox-value").setAttribute('value', weath.toString());
                //BMI
                jktj.computeBMI();
                //jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(10) > td:nth-child(4) > label > span > input.textbox-value").value = Math.round(weath/(pDate[0]*pDate[0]) / 100) / 100
                //设置腰围
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(10) > td:nth-child(2) > label > span > input.textbox-value").setAttribute('value', Math.round(pDate[0] * 0.34).toString());
                //设置心率
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(45) > td:nth-child(2) > label:nth-child(1) > span > input.textbox-value").setAttribute('value', xinLv)
                //健康评价
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(102) > td:nth-child(2) > label:nth-child(2) > span").click();
                var duanLian = jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(16) > td:nth-child(3)").children;
                for (let index = 3; index > 0; index--) {
                    const element = duanLian[index];
                    if (element.getAttribute('style') != 'color: rgb(0, 0, 0);') {
                        if (index == 3) {
                            jktj.document.getElementById("yc1").value = '1.生活方式异常(不锻炼)';
                            console.log('不锻炼');
                            break;
                        } else if (index == 2) {
                            jktj.document.getElementById("yc1").value = '1.生活方式异常(偶尔锻炼)';
                            break;
                        } else {
                            jktj.document.getElementById("yc1").value = '1.生活方式异常(偶尔锻炼)';
                            jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(16) > td:nth-child(3) > label:nth-child(3) > span > input").click();
                            break;
                        }
                    }
                }
                jktj.document.getElementById("yc1").dispatchEvent(new Event('keyup'));
                //健康指导
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(103) > td:nth-child(2) > label:nth-child(7) > span").click();
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(103) > td:nth-child(2) > label:nth-child(7) > input").value = '适当运动';
                jktj.$("#form_jktj > table > tbody > tr:nth-child(103) > td:nth-child(2) > label:nth-child(7) > input").trigger('change');
                //危险因素控制
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(103) > td:nth-child(4) > label:nth-child(5) > span").click();
                // clearInterval(main);
                // button.textContent = "已停止";
                // return;
                //save
                jktj.document.querySelector("#saveBtn").click();
                zT = 5;
            } else if (zT == 5) {
                document.querySelector("#centerTabs > div.tabs-header.tabs-header-noborder > div.tabs-wrap > ul > li.tabs-last.tabs-selected > a.tabs-close").click();
                zT = 0;
                rawNumber++;
                wanChengShu++;
                jiHang.value = (rawNumber + 1).toString();
                GM_setValue('hang', rawNumber);
                if (jiHua) {
                    if (jiHua <= wanChengShu) {
                        button.textContent = '已完成'+wanChengShu+'人';
                        button1.textContent = '运行';
                        clearInterval(main);
                        return;
                    }
                }
                button1.textContent = '已完成'+wanChengShu+'人';

                //clearInterval(main);
            } else if (zT == 7) {
                var jktj = document.querySelector("#centerTabs > div.tabs-panels.tabs-panels-noborder.panel-noscroll > div:nth-child(3) > div > iframe").contentWindow;
                //ti 食、烟、酒、职
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(16) > td:nth-child(3) > label:nth-child(4) > span > input").click();
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(19) > td:nth-child(2) > label:nth-child(1) > span > input").click();
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(20) > td:nth-child(3) > label:nth-child(1) > span > input").click();
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(23) > td:nth-child(3) > label:nth-child(1) > span > input").click();
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(28) > td:nth-child(2) > label:nth-child(1) > span > input").click();
                //kou
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(33) > td:nth-child(2) > label:nth-child(1) > span > input").click();
                jktj.document.querySelector("#cl48_1").click();
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(33) > td:nth-child(2) > label:nth-child(18) > span > input").click();
                //shi
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(34) > td:nth-child(2) > label:nth-child(1) > span > input.textbox-value").value = pDate[1];
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(34) > td:nth-child(2) > label:nth-child(2) > span > input.textbox-value").value = pDate[2];
                //t d p g l
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(35) > td:nth-child(2) > label:nth-child(1) > span > input").click();
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(36) > td:nth-child(2) > label:nth-child(1) > span > input").click();
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(39) > td:nth-child(2) > label:nth-child(1) > span > input").click();
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(40) > td:nth-child(2) > label:nth-child(1) > span > input").click();
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(41) > td:nth-child(2) > label:nth-child(1) > span > input").click();
                //fei
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(42) > td:nth-child(2) > label:nth-child(1) > span > input").click();
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(43) > td > label:nth-child(1) > span > input").click();
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(44) > td > label:nth-child(1) > span > input").click();
                //xin
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(45) > td:nth-child(2) > label:nth-child(4) > span > input").click();
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(45) > td:nth-child(2) > label:nth-child(9) > span > input").click();
                //fu
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(46) > td:nth-child(2) > label:nth-child(1) > span > input").click();
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(46) > td:nth-child(2) > label:nth-child(7) > span > input").click();
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(46) > td:nth-child(2) > label:nth-child(13) > span > input").click();
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(46) > td:nth-child(2) > label:nth-child(3) > span > input").click();
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(46) > td:nth-child(2) > label:nth-child(9) > span > input").click();
                //xia   nao shen xin
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(47) > td:nth-child(2) > label:nth-child(1) > span > input").click();

                jktj.document.querySelector("#nxgjb126_1").click();
                jktj.document.querySelector("#szjb128_1").click();
                jktj.document.querySelector("#xzjb130_1").click();
                //xue yan shen qi
                jktj.document.querySelector("#xgjb132_1").click();
                jktj.document.querySelector("#ybjb134_1").click();
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(79) > td:nth-child(2) > label:nth-child(1) > span > input").click();
                jktj.document.querySelector("#form_jktj > table > tbody > tr:nth-child(80) > td:nth-child(2) > label:nth-child(1) > span > input").click();

                zT = 4;
            } else {
                alert('zT =='+zT);
                clearInterval(main);
            }
        }, 2000);
    })

    var jiHang = document.createElement('input');
    jiHang.value = (GM_getValue('hang', 0) + 1).toString();
    jiHang.type = 'text';
    jiHang.title = '自定义从第几行开始';
    jiHang.size = '2';

    var jiHuaK = document.createElement('input');
    jiHuaK.value = GM_getValue('jiHua', 0);
    jiHuaK.type = 'text';
    jiHuaK.title = '计划一次运行几人，填0则无限';
    jiHuaK.size = '2';
    jiHuaK.onchange = function () {
        if (Number(jiHuaK.value) == NaN) {
            alert('输入数字');
            return;
        }
        jiHua = Number(jiHuaK.value);
        GM_setValue('jiHua', Number(jiHuaK.value))
    }

    var jiYe = document.createElement('input');
    jiYe.value = '1';
    jiYe.type = 'text';
    jiYe.size = '2';

    //let div = document.getElementById('sessionInfoDiv');
    //div.appendChild(button);
/*     let quTanChuang = setInterval(function(){
        console.log(document.getElementsByClassName('panel-tool-close').length);
        if(document.getElementsByClassName('panel-tool-close').length){
            document.getElementsByClassName('panel-tool-close')[1].click();
            document.getElementsByClassName('panel-tool-close')[0].click();
            clearInterval(quTanChuang);
        }

    },50)
 */

    setTimeout(function(){
        let div = document.getElementById('sessionInfoDiv');
        div.appendChild(jiHang);
        div.appendChild(jiHuaK);

        div.appendChild(button);
        div.appendChild(button1);

        document.getElementsByClassName('panel-tool-close')[1].click();
        document.getElementsByClassName('panel-tool-close')[0].click();
        let lis = document.getElementsByClassName("panel-header accordion-header");
        for (let i = 0; i < lis.length; i++){
            if (lis[i].childNodes[0].innerHTML == "综合查询"){
                lis[i].click();
                break;
            }
        }
        setTimeout(function(){
            document.querySelector("#myaccrdion > div:nth-child(2) > div.menuList.panel-body.accordion-body > ul > li:nth-child(1) > a").click();

            setTimeout(() => {
                let ptrq = document.createElement('input');
                ptrq.setAttribute('type','hidden');
                ptrq.setAttribute('class','textbox-value');
                ptrq.setAttribute('name','');
                ptrq.setAttribute('value','普通人群');
                var jmcx = document.querySelector("#centerTabs > div.tabs-panels.tabs-panels-noborder.panel-noscroll > div.panel.easyui-fluid > div > iframe").contentWindow;
                jmcx.document.querySelector("#fm > div > table > tbody > tr:nth-child(2) > td:nth-child(2) > span").appendChild(ptrq);
                jmcx.document.querySelector("#fm > div > table > tbody > tr:nth-child(3) > td:nth-child(5) > a.easyui-linkbutton.c1.l-btn.l-btn-small").click();

                setTimeout(() => {
                    var ele = document.querySelector("#centerTabs > div.tabs-panels.tabs-panels-noborder.panel-noscroll > div.panel.easyui-fluid > div > iframe").contentWindow.document.querySelector("body > div.panel.datagrid.easyui-fluid > div.datagrid-wrap.panel-body > div.datagrid-pager.pagination > table > tbody > tr > td:nth-child(7) > input");
                    ele.value = GM_getValue('ye', 1);
                    var enter = new Event('keydown');
                    enter.keyCode = 13;
                    ele.dispatchEvent(enter);
                }, 500);
            }, 500);

        },1000)

    },2000);

})();